<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数据类型</title>
</head>
<body>
<h2>数据类型的概念</h2>

<p>当数值和字符串相加时，JavaScript 将把数值视作字符串。</p>

<p id="demo"></p>

<script>
  var x = 911 + "Porsche";<!--结果：911Porsche-->
  //2.var x = "Porsche" +911;   结果：Porsche911
  //3.var x = 911 + 7 + "Porsche";  结果：918Porsche
  //4.var x = "Porsche" + 911 + 7;   结果：Porsche9117
  document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>
<!--由于第一个操作数是字符串，因此所有操作数都被视为字符串-->